package com.tanhua.server.service;

import com.tanhua.server.interceptors.UserHolder;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class RocketMqService {

    @Autowired
    private RocketMQTemplate rocketMQTemplate;

    public void sendMsg(String movementId,Integer type){ // 谁 对哪个圈子 做了什么动作

        Map map = new HashMap();
        map.put("userId", UserHolder.getUserId());
        map.put("movementId",movementId);
        map.put("type",type);
        rocketMQTemplate.convertAndSend("recommend_quanzi_logs",map);
        System.out.println("对圈子操作的日志数据已经放入到mq中................");
    }
}
